<!DOCTYPE html>
<html>
  <head>
    <meta charset="utf-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <meta name="viewport" content="width=device-width,initial-scale=1.0" />
    <link rel="icon" href="<%= BASE_URL %>favicon.ico" />
    <title>SISU_AA</title>
    <style>
      body {
        position: relative;
        /* width: 1280px;
        height: 720px; */
        box-sizing: border-box;

        /* 指定缩放的原点在左上角 */
        transform-origin: left top;
      }
    </style>
  </head>
  <body>
    <noscript>
      <strong
        >We're sorry but <%= htmlWebpackPlugin.options.title %> doesn't work
        properly without JavaScript enabled. Please enable it to
        continue.</strong
      >
    </noscript>
    <div id="app"></div>
    <!-- built files will be auto injected -->

    <script>
      function resetHtmlFont() {
        // 设计稿:  1920 * 1080
        // 目标适配:  1920 * 1080   3840 * 2160 ( 2 * 2 ) ;  7680 * 2160( 4 * 2)

        // 1.设计稿的尺寸
        let targetX = 1280;
        // let targetY = 1080
        // let targetRatio = 16 / 9 // 宽高比率

        // 2.拿到当前设备(浏览器)的宽度
        // 如果没有 html 我就拿 body 的宽度
        let currentX =
          document.documentElement.clientWidth || document.body.clientWidth;
        // console.log(currentX);
        //  1920 * 1080  -> 3840 * 2160

        // 3.计算缩放比例
        let scaleRatio = currentX / targetX; // 参照宽度进行缩放

        // 4.开始缩放网页
        document.body.style = `transform: scale(${scaleRatio})`;
      }
      // resetHtmlFont();

      // 窗口发生变化，会重新计算宽度比
      // window.onresize = resetHtmlFont;
    </script>
  </body>
</html>
